testsuite: Improve coverage for GtkMultiSorter
authorMatthias Clasen <mclasen@redhat.com>
Sat, 31 Oct 2020 03:33:34 +0000 (23:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 31 Oct 2020 03:33:34 +0000 (23:33 -0400)
testsuite/gtk/sorter.c

index ad6d94ebbb5422265441d8de6d321e713fddc842..6822c9ad082f899c04ea0af720c4b56bdd96459b 100644 (file)
@@ -405,6 +405,7 @@ test_multi (void)
   GtkSorter *sorter1;
   GtkSorter *sorter2;
   GtkExpression *expression;
+  gpointer item;
 
   model = new_model (20, NULL);
   assert_not_model (model, "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20");
@@ -424,6 +425,12 @@ test_multi (void)
   gtk_multi_sorter_append (GTK_MULTI_SORTER (sorter), sorter1);
   gtk_multi_sorter_append (GTK_MULTI_SORTER (sorter), sorter2);
 
+  g_assert_true (GTK_TYPE_SORTER == g_list_model_get_item_type (G_LIST_MODEL (sorter)));
+  g_assert_cmpuint (2, ==, g_list_model_get_n_items (G_LIST_MODEL (sorter)));
+  item = g_list_model_get_item (G_LIST_MODEL (sorter), 1);
+  g_assert_true (item == sorter2);
+  g_object_unref (item);
+
   assert_model (model, "2 4 6 8 10 12 14 16 18 20 1 3 5 7 9 11 13 15 17 19");
 
   /* This doesn't do anything */